<script>
	$(document).ready(function(){
	
		// load mahasiswa
		load_mahasiswa = function(){
			$('#nim').combogrid({
				panelWidth:450,
				panelHeight:275,
				value:'',
			 
				idField:'nim',
				textField:'nim',
				url:base_url+'prosedur/getMahasiswabySeminar/'+$('#kd_prodi').val(),
				columns:[[
					{field:'nim',title:'NIM',width:130},
					{field:'nama',title:'Nama',width:250}
				]],
				onChange: function(value){
					//getsemester();
				}
			});
		}

	
		$('#kd_fakultas').change(function(){
			$('#kd_prodi').load(base_url+'prosedur/getProdibyFakultas/'+$('#kd_fakultas').val());
		});
		
		$('#kd_prodi').change(function(){
			$('#penguji1').load(base_url+'prosedur/getDosenbyProdiTa/'+$('#kd_prodi').val());
			$('#penguji2').load(base_url+'prosedur/getDosenbyProdiTa/'+$('#kd_prodi').val());
			$('#ketua_sidang').load(base_url+'prosedur/getDosenbyProdiTa/'+$('#kd_prodi').val());
			load_mahasiswa();
		});
		//# Kimochi - otoritas
		<?if($this->session->userdata('kd_fakultas')!='' && $this->session->userdata('kd_prodi')!='' && $aksi=='add'){?>
			$('#penguji1').load(base_url+'prosedur/getDosenbyProdiTa/'+$('#kd_prodi').val());
			$('#penguji2').load(base_url+'prosedur/getDosenbyProdiTa/'+$('#kd_prodi').val());
			$('#ketua_sidang').load(base_url+'prosedur/getDosenbyProdiTa/'+$('#kd_prodi').val());
			load_mahasiswa();
		<?}?>
		//# End Kimochi
	});
</script>
<form id="form1" method="post" style="margin:10px" enctype="multipart/form-data">
	<input type="hidden" name="id" id="id" value="<?=$id?>">
	<input type="hidden" name="status" id="status" value="A">
	<div class="fitem" >
		<label style="width:100px">Tahun Ajaran </label>:
		<select id="tahun_id" name="tahun_id" style="width:200px;"<?php if($aksi == 'edit'){echo 'disabled';}?>>
					<?=$this->mdl_prosedur->OptionTahunAjaran(array('value'=>$tahun_id));?>
			</select>
		<!--input name="tahun_id" size="30" value="<?=$tahun_id?>" -->
	</div>
	<div class="fitem" >
		<label style="width:100px">Fakultas </label>:
			<select id="kd_fakultas" name="kd_fakultas" style="width:200px;" <?php if($aksi == 'edit'){echo 'disabled';}?>>
					<?=$this->mdl_prosedur->OptionFakultas(array('value'=>$kd_fakultas));?>
			</select>
				<label> </label>
	</div>
	<div class="fitem" >
				<label style="width:100px">Prodi  </label>:
				<select id="kd_prodi" name="kd_prodi" style="width:200px;" <?php if($aksi == 'edit'){echo 'disabled';}?>>
			<?php
				if($aksi == 'edit')
					echo $this->mdl_prosedur->OptionProdi(array('value'=>$kd_prodi , 'kd_fakultas'=>$kd_fakultas));
				else 
					//echo '<option value="">-- Pilih --</option>';
					echo $this->mdl_prosedur->OptionProdi(array('value'=>$kd_prodi , 'kd_fakultas'=>$kd_fakultas));
			?>
		</select>
		
	</div>	
	<div class="fitem" >
		<label style="width:100px">Nim </label>:
		<input  id ="nim" name="nim" size="30" value="<?=$nim?>" <?php if($aksi == 'edit'){echo 'readonly';}?>>
	</div>
	<div class="fitem" >
		<label style="width:100px">Penguji 1</label>:
		
		<select id="penguji1" name="penguji1" style="width:200px;" >
		<!-- "disable kombo" select id="pembimbing1" name="pembimbing1" style="width:200px;" <?php if($aksi == 'edit'){echo 'disabled';}?>-->
			<?php
				if($aksi == 'edit')
					echo $this->mdl_prosedur->OptionDosenTa(array('value'=>$penguji1 , 'kd_prodi'=>$kd_prodi));
				else 
					echo '<option value="">-- Pilih --</option>';
			?>
		</select>

	</div>
	<div class="fitem" >
		<label style="width:100px">Penguji 2</label>:
		
		<select id="penguji2" name="penguji2" style="width:200px;" >
		<!-- "disable kombo" select id="pembimbing1" name="pembimbing1" style="width:200px;" <?php if($aksi == 'edit'){echo 'disabled';}?>-->
			<?php
				if($aksi == 'edit')
					echo $this->mdl_prosedur->OptionDosenTa(array('value'=>$penguji2 , 'kd_prodi'=>$kd_prodi));
				else 
					echo '<option value="">-- Pilih --</option>';
			?>
		</select>

	</div>
	<div class="fitem" >
		<label style="width:100px">Ketua Sidang</label>:
		
		<select id="ketua_sidang" name="ketua_sidang" style="width:200px;" >
		<!-- "disable kombo" select id="pembimbing1" name="pembimbing1" style="width:200px;" <?php if($aksi == 'edit'){echo 'disabled';}?>-->
			<?php
				if($aksi == 'edit')
					echo $this->mdl_prosedur->OptionDosenTa(array('value'=>$ketua_sidang , 'kd_prodi'=>$kd_prodi));
				else 
					echo '<option value="">-- Pilih --</option>';
			?>
		</select>

	</div>
	<div class="fitem" >
		<label style="width:100px">Status</label>:		
		<select id="sidang" name="sidang">
			<option value="">- Pilih Status -</option>
			<option value="Lulus" <?=$sidang == 'Lulus'?'selected ="selected"':''; ?>>Lulus</option>
			<option value="Tidak Lulus" <?=$sidang == 'Tidak Lulus'?'selected ="selected"':''; ?>>Tidak Lulus</option>
			
		</select>
	</div>
	<div class="fitem" >
		<label style="width:100px;vertical-align:top;">Keterangan</label>
		<textarea name="keterangan" id="keterangan" cols="25" rows="3"><?=$keterangan?></textarea>
	</div>
	<div class="fitem" >
					<label style="width:100px">File Tugas Akhir *pdf</label>:
					<input name="userfile" value="file_upload" type="file" size="10"/>
				</div>
	<div class="fitem" >
		<label style="width:100px">Tanggal Sidang</label>:
		<input class="easyui-datebox" name="tgl_sidang" size="30" value="<?=$tgl_sidang?>" id="tgl_sidang" data-options="formatter:DateFormatter, parser:DateParser">
	</div>
	<div class="fitem" >
		<label style="width:100px">Tanggal Yudisium</label>:
		<input class="easyui-datebox" name="tgl_yudisium" size="30" value="<?=$tgl_yudisium?>" id="tgl_yudisium" data-options="formatter:DateFormatter, parser:DateParser">
	</div>
	
	<div class="fitem" >
		<label style="width:100px">Yudisuim</label>:		
		<select id="sk_yudisium" name="sk_yudisium">
			<option value="">- Pilih Status -</option>
			<option value="Cumlaude" <?=$sk_yudisium == 'Cumlaude'?'selected ="selected"':''; ?>>Cumlaude</option>
			<option value="Sangat Memuaskan" <?=$sk_yudisium == 'Sangat Memuaskan'?'selected ="selected"':''; ?>>Sangat Memuaskan</option>
			<option value="Memuaskan" <?=$sk_yudisium == 'Memuaskan'?'selected ="selected"':''; ?>>Memuaskan</option>
			
		</select>
	</div>
</form>
	

